﻿namespace CRM.Business.Services
{
    using System.Collections.Generic;
    using CRM.DataAccess.DAOs;
    using CRM.DataAccess.Entities;
    using System;

    public static class OrganizationService
    {
        /// Gets or sets the role DAO.
        private static OrganizationDAO OrganizationDAO = new OrganizationDAO();

        //Get Rating By Name
        public static ORGANIZATION_RATING getRatingbyName(string name)
        {
            return OrganizationDAO.GetRatingByName(name);
        }
        // add new Rating
        public static int AddnewRating(ORGANIZATION_RATING ot)
        {
            return OrganizationDAO.AddNewRating(ot);
        }
        //Get Type By Name
        public static ORGANIZATION_TYPE getTypebyName(string name)
        {
            return OrganizationDAO.GetTypeByName(name);
        }
        // add new Type
        public static int AddnewType(ORGANIZATION_TYPE ot)
        {
            return OrganizationDAO.AddNewType(ot);
        }
        //Get Industry By Name
        public static ORGANIZATION_INDUSTRY getIndustryByName(string name)
        {
            return OrganizationDAO.GetIndustryByName(name);
        }
        // add new Industry
        public static int AddnewIndustry(ORGANIZATION_INDUSTRY oi)
        {
            return OrganizationDAO.AddNewIndustry(oi);
        }
        // Get Organization By ID
        public static ORGANIZATION GetOrganizationByID(long id)
        {
            return OrganizationDAO.GetOrganizationByID(id);
        }
        // get Organization By OrgName
        public static ORGANIZATION GetOrganizationByOrgName(string OrgName)
        {
            return OrganizationDAO.GetOrganizationByOrgName(OrgName);
        }
        // get Organization Detail by Id
        public static ORGANIZATION_DETAIL GetOrganizationDetailByID(long id)
        {
            return OrganizationDAO.GetOrganizationDetailByID(id);
        }
        //update Organization
        public static int UpdateOrganization(ORGANIZATION org)
        {
            return OrganizationDAO.UpdateOrganization(org);
        }
       
        //Get Org Type
        public static List<ORGANIZATION_TYPE> GetOrganizationType()
        {
           return OrganizationDAO.GetOrganizationType();
       }
        //Get Org Industry
        public static List<ORGANIZATION_INDUSTRY> GetOrganizationIndustry()
        {
            return OrganizationDAO.GetOrganizationIndustry();
        }
        
        //Get Org Rating
        public static List<ORGANIZATION_RATING> GetOrganizationRating()
        {
            return OrganizationDAO.GetOrganizationRating();
        }
        //Check exist
        public static int CheckExist(string orgname)
        {
            return OrganizationDAO.CheckExist(orgname);
        }
        //delete org
        public static int DeleteOrganization(long orgID)
        {
            return OrganizationDAO.DeleteOrganization(orgID);
        }
        //add list Org from excel file
        public static int AddListOrgFromExcelFile(List<ORGANIZATION> Orgs)
        {
            return OrganizationDAO.AddListOrgFromExcelFile(Orgs);
        }
        //Add new Org
        public static int AddNewOrganization(ORGANIZATION org)
        {
            return OrganizationDAO.AddNewOrganization(org);
        }

        public static List<ORGANIZATION_DETAIL> GetOrganizationByCondition(DateTime? dateFrom, DateTime? dateTo, long? assignedtoID, string orgname, string conNumber, string primaryemail)
        {
            return OrganizationDAO.GetOrganizationByCondition(dateFrom, dateTo,assignedtoID, orgname, conNumber, primaryemail);
        }
         //Get Org distinc by condition
        public static List<ORGANIZATION> GetCompanyByCondition(DateTime? dateFrom, DateTime? dateTo, long? assignedToID, string orgname, string contactnumber, string primaryemail)
        {
            return OrganizationDAO.GetCompanyByCondition(dateFrom, dateTo,assignedToID, orgname, contactnumber, primaryemail);
        }
        public static List<ORGANIZATION_NOT_SEND_INVOICE_QUOTE> GetOrgNotSendInvoiceAndQuoteByCondition(long userID, string orgname, string primaryphone, string primaryemail)
        {
            return OrganizationDAO.GetOrgNotSendInvoiceAndQuoteByCondition(userID, orgname, primaryphone, primaryemail);
        }
        // get all Org 
        public static List<ORGANIZATION> ListAll(long? assignedToID)
        {
            return OrganizationDAO.ListAll(assignedToID);
        }
        
    }
}
